home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / grafica / amhelios / hc_delta.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  2KB  |  85 lines

  1. ////////////////////////////////////////////////////////////
  2. //
  3. //  HC_DELTA.H - Hemicube Delta Form Factor Class
  4. //
  5. //  Version:    1.03A
  6. //
  7. //  History:    94/08/23 - Version 1.00A release.
  8. //              94/12/16 - Version 1.01A release.
  9. //              95/02/05 - Version 1.02A release.
  10. //              95/07/21 - Version 1.02B release.
  11. //              96/02/14 - Version 1.02C release.
  12. //              96/04/01 - Version 1.03A release.
  13. //
  14. //  Compilers:  Microsoft Visual C/C++ Professional V1.5
  15. //              Borland C++ Version 4.5
  16. //
  17. //  Author:     Ian Ashdown, P.Eng.
  18. //              byHeart Software Limited
  19. //              620 Ballantree Road
  20. //              West Vancouver, B.C.
  21. //              Canada V7S 1W3
  22. //              Tel. (604) 922-6148
  23. //              Fax. (604) 987-7621
  24. //
  25. //  Copyright 1994-1996 byHeart Software Limited
  26. //
  27. //  The following source code has been derived from:
  28. //
  29. //    Ashdown, I. 1994. Radiosity: A Programmer's
  30. //    Perspective. New York, NY: John Wiley & Sons.
  31. //
  32. //  It may be freely copied, redistributed, and/or modified
  33. //  for personal use ONLY, as long as the copyright notice
  34. //  is included with all source code files.
  35. //
  36. ////////////////////////////////////////////////////////////
  37.  
  38. #ifndef _HC_DELTA_H
  39. #define _HC_DELTA_H
  40.  
  41. #include "general.h"
  42. #include "ff_delta.h"
  43.  
  44. static const int HC_ArrayDim = FF_ArrayRes / 2;
  45.  
  46. class HemiDelta         // Hemicube delta form factors
  47. {
  48.   private:
  49.     static float side_array[HC_ArrayDim][HC_ArrayDim];
  50.     static float top_array[HC_ArrayDim][HC_ArrayDim];
  51.  
  52.   public:
  53.     HemiDelta();
  54.  
  55.     // Get top face cell form factor
  56.     float GetTopFactor( int row, int col )
  57.     {
  58.       if (row >= HC_ArrayDim)
  59.         row -= HC_ArrayDim;
  60.       else
  61.         row = HC_ArrayDim - row - 1;
  62.  
  63.       if (col >= HC_ArrayDim)
  64.         col -= HC_ArrayDim;
  65.       else
  66.         col = HC_ArrayDim - col - 1;
  67.  
  68.       return top_array[row][col];
  69.     }
  70.  
  71.     // Get side face cell form factor
  72.     float GetSideFactor( int row, int col )
  73.     {
  74.       if (col >= HC_ArrayDim)
  75.         col -= HC_ArrayDim;
  76.       else
  77.         col = HC_ArrayDim - col - 1;
  78.  
  79.       return side_array[row - HC_ArrayDim][col];
  80.     }
  81. };
  82.  
  83. #endif
  84.  
  85.